Skip to content

docs links test improvements#20797

Draft
rmynar wants to merge 1 commit intoSatelliteQE:masterfrom
rmynar:sat-41822
Draft

docs links test improvements#20797
rmynar wants to merge 1 commit intoSatelliteQE:masterfrom
rmynar:sat-41822

Conversation

@rmynar
Copy link
Contributor

@rmynar rmynar commented Feb 12, 2026

Improvements to test_positive_documentation_links:

  1. The test is parametrized, so there's one test per page, which makes it easier to analyze results
  2. There's a module scoped session which keeps user logged in during testing links on each page (saves time)

Summary by Sourcery

Parametrize documentation link E2E test by page and reuse a shared UI session to speed up execution while keeping per-page assertions and logging.

Tests:

  • Parametrize test_positive_documentation_links over individual pages instead of looping internally, producing separate test cases per page.
  • Introduce a module-scoped UI session fixture to reuse a logged-in session across documentation link checks and reduce test runtime.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 12, 2026

Reviewer's Guide

Parametrizes the documentation-links UI test per page and introduces a module-scoped UI session fixture to reuse login and simplify per-page link validation logic.

File-Level Changes

Change Details Files
Extracts the list of tested UI pages to a shared module-level constant and parametrizes the documentation links test over that list.
  • Defines a module-level pages list containing all page identifiers previously defined inside the test.
  • Applies pytest.mark.parametrize over the pages list so one test case is generated per page.
  • Updates test_positive_documentation_links signature to accept the page parameter instead of looping internally.
tests/foreman/ui/test_documentation_links.py
Introduces a reusable module-scoped UI session fixture and restructures the test to operate on a single page per test invocation.
  • Adds a module-scoped session fixture that opens module_target_sat.ui_session() once and yields the session for reuse across parametrized tests.
  • Replaces target_sat usage with module_target_sat to match fixture scope and reuse the same session.
  • Moves navigation and documentation_links collection logic out of an inner for-loop to run once per parametrized page.
  • Keeps per-page link checking logic but now accumulates broken links in pages_with_broken_links for the single active page and asserts that none are found.
tests/foreman/ui/test_documentation_links.py
Adjusts documentation link resolution logic to work with the new fixtures and slightly alters the stage-docs handling.
  • Updates hostname checks from target_sat.hostname to module_target_sat.hostname when resolving internal doc URLs.
  • Keeps Non-GA Satellite handling by rewriting docs.redhat.com URLs to the configured stage_docs_url, with the html-to-html-single replacement commented out instead of applied.
  • Ensures logging and assertion messages still report per-page link status after the refactor.
tests/foreman/ui/test_documentation_links.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@rmynar rmynar added CherryPick PR needs CherryPick to previous branches AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing 6.19.z labels Feb 12, 2026
@rmynar rmynar self-assigned this Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.19.z AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant